package cn.sdhuijin.controller;

import java.util.List;

import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.sdhuijin.model.TargetScore;
import cn.sdhuijin.service.TargetService;

/**
 * @author sunp@sdhuijin.cn:
 * @version 创建时间：2015年5月4日 下午2:21:32 类说明
 */

@Controller
public class IndexController {

	@Inject
	private TargetService targetService;

	@RequestMapping(value = { "/index" })
	public ModelAndView Index(HttpServletRequest req, HttpSession session) {
		ModelAndView mv;
		mv = new ModelAndView("index");
		return mv;
	}

	@RequestMapping(value = { "/", "/login" })
	public ModelAndView Login(HttpServletRequest req, HttpSession session) {
		ModelAndView mv;
		mv = new ModelAndView("login");
		return mv;
	}

	@RequestMapping(value = { "/index_main" })
	public String IndexMain(HttpServletRequest req, HttpSession session, Model m) {
		List<TargetScore> targetScoreList = null;
		targetScoreList = targetService.getTargetScoreDesc();
		m.addAttribute("targetScoreList", targetScoreList);
		return "index_main";
	}

	@RequestMapping(value = { "/top" })
	public ModelAndView Top(HttpServletRequest req, HttpSession session) {
		ModelAndView mv;
		mv = new ModelAndView("top");
		return mv;
	}

	@RequestMapping(value = { "/bottom" })
	public ModelAndView Bottom(HttpServletRequest req, HttpSession session) {
		ModelAndView mv;
		mv = new ModelAndView("bottom");
		return mv;
	}

	@RequestMapping(value = { "/content" })
	public String getContentJsp(HttpServletRequest req, HttpSession session,
			Model m) {
		return "content";
	}

	@RequestMapping(value = { "/contentLeft" })
	public String getContentLeftJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "content_left";
	}

	/**
	 * 工作考核记录
	 * @param req
	 * @param session
	 * @param m
	 * @return
	 */
	@RequestMapping(value = { "/standardDeductionList" })
	public String getStandardDeductionListJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "standard_deduction_list";
	}
	
	/**
	 * 考核变更申请
	 * @param req
	 * @param session
	 * @param m
	 * @return
	 */
	@RequestMapping(value = { "/appealApplyList" })
	public String getAppealApplyListJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "appeal_apply_list";
	}
	
	/**
	 * 考核变更申请
	 * @param req
	 * @param session
	 * @param m
	 * @return
	 */
	@RequestMapping(value = { "/appealViewList" })
	public String getAppealViewListJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "appeal_view_list";
	}
	
	/**
	 * 工作考核展示
	 * @param req
	 * @param session
	 * @param m
	 * @return
	 */
	@RequestMapping(value = { "/standardViewList" })
	public String getStandardViewListJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "standard_view_list";
	}
	
	/**
	 * 考核标准维护
	 * @param req
	 * @param session
	 * @param m
	 * @return
	 */
	@RequestMapping(value = { "/standardList" })
	public String getStandardListJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "standard_list";
	}
	
	/**
	 * 考核对象维护
	 * @param req
	 * @param session
	 * @param m
	 * @return
	 */
	@RequestMapping(value = { "/standardTargetList" })
	public String getStandardTargetListJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "standard_target_list";
	}
	
	/**
	 * 用户管理
	 * @param req
	 * @param session
	 * @param m
	 * @return
	 */
	@RequestMapping(value = { "/userList" })
	public String getUserListJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "user_list";
	}
	
	
	@RequestMapping(value = { "/notifyList" })
	public String getNotifyListJsp(HttpServletRequest req,
			HttpSession session, Model m) {
		return "notify_list";
	}

}
